package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbAddressMapper;
import com.dongdongshop.pojo.TbAddress;
import com.dongdongshop.service.AddRessService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DubboService
public class AddRessServiceImpl implements AddRessService {

    @Autowired
    private TbAddressMapper tbAddressMapper;

    @Override
    public List<TbAddress> getAddressInfo(String username) {

        return tbAddressMapper.getAddressInfo(username);
    }

    @Override
    public void saveAddress(TbAddress address) {
        tbAddressMapper.insertSelective(address);
    }

    @Override
    public void deleteAddress(Long id) {
        tbAddressMapper.deleteByPrimaryKey(id);
    }
}
